/**
 * @mbggenerated
 * @author wujian
 */
package bearworker.zxl.dao.mapper;

import bearworker.zxl.entity.DeliveryWxpayRecords;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;

public interface DeliveryWxpayRecordsMapper {
    /* @mbggenerated */
    @Delete({
        "delete from delivery_wxpay_records",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int deleteByPrimaryKey(Integer id);

    /* @mbggenerated */
    @Insert({
        "insert into delivery_wxpay_records (appid, mch_id, ",
        "nonce_str, sign, ",
        "body, out_trade_no, ",
        "total_fee, spbill_create_ip, ",
        "notify_url, trade_type, ",
        "openid, res_return_code, ",
        "res_return_msg, res_appid, ",
        "res_mch_id, res_nonce_str, ",
        "res_sign, res_result_code, ",
        "res_prepay_id, res_trade_type, ",
        "create_time, js_timeStamp, ",
        "js_package, js_signType, ",
        "js_sign)",
        "values (#{appid,jdbcType=VARCHAR}, #{mchId,jdbcType=VARCHAR}, ",
        "#{nonceStr,jdbcType=VARCHAR}, #{sign,jdbcType=VARCHAR}, ",
        "#{body,jdbcType=VARCHAR}, #{outTradeNo,jdbcType=VARCHAR}, ",
        "#{totalFee,jdbcType=INTEGER}, #{spbillCreateIp,jdbcType=VARCHAR}, ",
        "#{notifyUrl,jdbcType=VARCHAR}, #{tradeType,jdbcType=VARCHAR}, ",
        "#{openid,jdbcType=VARCHAR}, #{resReturnCode,jdbcType=VARCHAR}, ",
        "#{resReturnMsg,jdbcType=VARCHAR}, #{resAppid,jdbcType=VARCHAR}, ",
        "#{resMchId,jdbcType=VARCHAR}, #{resNonceStr,jdbcType=VARCHAR}, ",
        "#{resSign,jdbcType=VARCHAR}, #{resResultCode,jdbcType=VARCHAR}, ",
        "#{resPrepayId,jdbcType=VARCHAR}, #{resTradeType,jdbcType=VARCHAR}, ",
        "#{createTime,jdbcType=TIMESTAMP}, #{jsTimestamp,jdbcType=VARCHAR}, ",
        "#{jsPackage,jdbcType=VARCHAR}, #{jsSigntype,jdbcType=VARCHAR}, ",
        "#{jsSign,jdbcType=VARCHAR})"
    })
    @Options(useGeneratedKeys=true,keyProperty="id")
    int insert(DeliveryWxpayRecords record);

    /* @mbggenerated */
    @InsertProvider(type=DeliveryWxpayRecordsSqlProvider.class, method="insertSelective")
    @Options(useGeneratedKeys=true,keyProperty="id")
    int insertSelective(DeliveryWxpayRecords record);

    /* @mbggenerated */
    @Select({
        "select",
        "id, appid, mch_id, nonce_str, sign, body, out_trade_no, total_fee, spbill_create_ip, ",
        "notify_url, trade_type, openid, res_return_code, res_return_msg, res_appid, ",
        "res_mch_id, res_nonce_str, res_sign, res_result_code, res_prepay_id, res_trade_type, ",
        "create_time, js_timeStamp, js_package, js_signType, js_sign",
        "from delivery_wxpay_records",
        "where id = #{id,jdbcType=INTEGER}"
    })
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.INTEGER, id=true),
        @Result(column="appid", property="appid", jdbcType=JdbcType.VARCHAR),
        @Result(column="mch_id", property="mchId", jdbcType=JdbcType.VARCHAR),
        @Result(column="nonce_str", property="nonceStr", jdbcType=JdbcType.VARCHAR),
        @Result(column="sign", property="sign", jdbcType=JdbcType.VARCHAR),
        @Result(column="body", property="body", jdbcType=JdbcType.VARCHAR),
        @Result(column="out_trade_no", property="outTradeNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="total_fee", property="totalFee", jdbcType=JdbcType.INTEGER),
        @Result(column="spbill_create_ip", property="spbillCreateIp", jdbcType=JdbcType.VARCHAR),
        @Result(column="notify_url", property="notifyUrl", jdbcType=JdbcType.VARCHAR),
        @Result(column="trade_type", property="tradeType", jdbcType=JdbcType.VARCHAR),
        @Result(column="openid", property="openid", jdbcType=JdbcType.VARCHAR),
        @Result(column="res_return_code", property="resReturnCode", jdbcType=JdbcType.VARCHAR),
        @Result(column="res_return_msg", property="resReturnMsg", jdbcType=JdbcType.VARCHAR),
        @Result(column="res_appid", property="resAppid", jdbcType=JdbcType.VARCHAR),
        @Result(column="res_mch_id", property="resMchId", jdbcType=JdbcType.VARCHAR),
        @Result(column="res_nonce_str", property="resNonceStr", jdbcType=JdbcType.VARCHAR),
        @Result(column="res_sign", property="resSign", jdbcType=JdbcType.VARCHAR),
        @Result(column="res_result_code", property="resResultCode", jdbcType=JdbcType.VARCHAR),
        @Result(column="res_prepay_id", property="resPrepayId", jdbcType=JdbcType.VARCHAR),
        @Result(column="res_trade_type", property="resTradeType", jdbcType=JdbcType.VARCHAR),
        @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="js_timeStamp", property="jsTimestamp", jdbcType=JdbcType.VARCHAR),
        @Result(column="js_package", property="jsPackage", jdbcType=JdbcType.VARCHAR),
        @Result(column="js_signType", property="jsSigntype", jdbcType=JdbcType.VARCHAR),
        @Result(column="js_sign", property="jsSign", jdbcType=JdbcType.VARCHAR)
    })
    DeliveryWxpayRecords selectByPrimaryKey(Integer id);

    @Select({
            "select",
            "id, appid, mch_id, nonce_str, sign, body, out_trade_no, total_fee, spbill_create_ip, ",
            "notify_url, trade_type, openid, res_return_code, res_return_msg, res_appid, ",
            "res_mch_id, res_nonce_str, res_sign, res_result_code, res_prepay_id, res_trade_type, ",
            "create_time, js_timeStamp, js_package, js_signType, js_sign",
            "from delivery_wxpay_records",
            "where out_trade_no = #{0,jdbcType=VARCHAR}"
    })
    @Results({
            @Result(column="id", property="id", jdbcType=JdbcType.INTEGER, id=true),
            @Result(column="appid", property="appid", jdbcType=JdbcType.VARCHAR),
            @Result(column="mch_id", property="mchId", jdbcType=JdbcType.VARCHAR),
            @Result(column="nonce_str", property="nonceStr", jdbcType=JdbcType.VARCHAR),
            @Result(column="sign", property="sign", jdbcType=JdbcType.VARCHAR),
            @Result(column="body", property="body", jdbcType=JdbcType.VARCHAR),
            @Result(column="out_trade_no", property="outTradeNo", jdbcType=JdbcType.VARCHAR),
            @Result(column="total_fee", property="totalFee", jdbcType=JdbcType.INTEGER),
            @Result(column="spbill_create_ip", property="spbillCreateIp", jdbcType=JdbcType.VARCHAR),
            @Result(column="notify_url", property="notifyUrl", jdbcType=JdbcType.VARCHAR),
            @Result(column="trade_type", property="tradeType", jdbcType=JdbcType.VARCHAR),
            @Result(column="openid", property="openid", jdbcType=JdbcType.VARCHAR),
            @Result(column="res_return_code", property="resReturnCode", jdbcType=JdbcType.VARCHAR),
            @Result(column="res_return_msg", property="resReturnMsg", jdbcType=JdbcType.VARCHAR),
            @Result(column="res_appid", property="resAppid", jdbcType=JdbcType.VARCHAR),
            @Result(column="res_mch_id", property="resMchId", jdbcType=JdbcType.VARCHAR),
            @Result(column="res_nonce_str", property="resNonceStr", jdbcType=JdbcType.VARCHAR),
            @Result(column="res_sign", property="resSign", jdbcType=JdbcType.VARCHAR),
            @Result(column="res_result_code", property="resResultCode", jdbcType=JdbcType.VARCHAR),
            @Result(column="res_prepay_id", property="resPrepayId", jdbcType=JdbcType.VARCHAR),
            @Result(column="res_trade_type", property="resTradeType", jdbcType=JdbcType.VARCHAR),
            @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
            @Result(column="js_timeStamp", property="jsTimestamp", jdbcType=JdbcType.VARCHAR),
            @Result(column="js_package", property="jsPackage", jdbcType=JdbcType.VARCHAR),
            @Result(column="js_signType", property="jsSigntype", jdbcType=JdbcType.VARCHAR),
            @Result(column="js_sign", property="jsSign", jdbcType=JdbcType.VARCHAR)
    })
    DeliveryWxpayRecords selectByOrderNo(String orderNo);

    /* @mbggenerated */
    @UpdateProvider(type=DeliveryWxpayRecordsSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(DeliveryWxpayRecords record);

    /* @mbggenerated */
    @Update({
        "update delivery_wxpay_records",
        "set appid = #{appid,jdbcType=VARCHAR},",
          "mch_id = #{mchId,jdbcType=VARCHAR},",
          "nonce_str = #{nonceStr,jdbcType=VARCHAR},",
          "sign = #{sign,jdbcType=VARCHAR},",
          "body = #{body,jdbcType=VARCHAR},",
          "out_trade_no = #{outTradeNo,jdbcType=VARCHAR},",
          "total_fee = #{totalFee,jdbcType=INTEGER},",
          "spbill_create_ip = #{spbillCreateIp,jdbcType=VARCHAR},",
          "notify_url = #{notifyUrl,jdbcType=VARCHAR},",
          "trade_type = #{tradeType,jdbcType=VARCHAR},",
          "openid = #{openid,jdbcType=VARCHAR},",
          "res_return_code = #{resReturnCode,jdbcType=VARCHAR},",
          "res_return_msg = #{resReturnMsg,jdbcType=VARCHAR},",
          "res_appid = #{resAppid,jdbcType=VARCHAR},",
          "res_mch_id = #{resMchId,jdbcType=VARCHAR},",
          "res_nonce_str = #{resNonceStr,jdbcType=VARCHAR},",
          "res_sign = #{resSign,jdbcType=VARCHAR},",
          "res_result_code = #{resResultCode,jdbcType=VARCHAR},",
          "res_prepay_id = #{resPrepayId,jdbcType=VARCHAR},",
          "res_trade_type = #{resTradeType,jdbcType=VARCHAR},",
          "create_time = #{createTime,jdbcType=TIMESTAMP},",
          "js_timeStamp = #{jsTimestamp,jdbcType=VARCHAR},",
          "js_package = #{jsPackage,jdbcType=VARCHAR},",
          "js_signType = #{jsSigntype,jdbcType=VARCHAR},",
          "js_sign = #{jsSign,jdbcType=VARCHAR}",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int updateByPrimaryKey(DeliveryWxpayRecords record);
}